<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>电路生成 :: 计算机组成原理实验指导</title>
    <meta name="generator" content="Antora 3.2.0-alpha.8">
    <link rel="stylesheet" href="../../_/css/site.css">
<!--    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> -->
  </head>
  <body class="article">
<header class="header">
  <nav class="navbar">
    <div class="navbar-brand">
      <a class="navbar-item" href="../..">计算机组成原理实验指导</a>
      <button class="navbar-burger" aria-controls="topbar-nav" aria-expanded="false" aria-label="Toggle main menu">
        <span></span>
        <span></span>
        <span></span>
      </button>
    </div>
    <div id="topbar-nav" class="navbar-menu">
      <div class="navbar-end">

        <div class="navbar-item">
          <span class="control">
            <a class="button is-primary" href="https://gitee.com/fpga-lab/digisimlab-open" target="_blank">Download</a>
          </span>
        </div>
      </div>
    </div>
  </nav>
</header>
<div class="body">
<div class="nav-container" data-component="digisimlab" data-version="1.2">
  <aside class="nav">
    <div class="panels">
<div class="nav-panel-menu is-active" data-panel="menu">
  <nav class="nav-menu">
    <button class="nav-menu-toggle" aria-label="Toggle expand/collapse all" style="display: none"></button>
    <h3 class="title"><a href="index.html">计算机组成原理实验指导</a></h3>
<ul class="nav-list">
  <li class="nav-item" data-depth="0">
<ul class="nav-list">
  <li class="nav-item" data-depth="1">
    <a class="nav-link" href="index.html">前言</a>
  </li>
</ul>
  </li>
  <li class="nav-item" data-depth="0">
    <button class="nav-item-toggle"></button>
    <span class="nav-text">Digital仿真软件使用指南</span>
<ul class="nav-list">
  <li class="nav-item" data-depth="1">
    <a class="nav-link" href="ds-brief-introduction.html">简介</a>
  </li>
  <li class="nav-item" data-depth="1">
    <a class="nav-link" href="introduce-digitalsim.html">下载、安装及启动</a>
  </li>
  <li class="nav-item" data-depth="1">
    <a class="nav-link" href="ds-getting-started.html">新手入门</a>
  </li>
  <li class="nav-item is-current-page" data-depth="1">
    <a class="nav-link" href="ds-generate-circuit.html">电路生成</a>
  </li>
  <li class="nav-item" data-depth="1">
    <a class="nav-link" href="ds-test-circuit.html">电路测试</a>
  </li>
  <li class="nav-item" data-depth="1">
    <a class="nav-link" href="ds-sim-dff.html">时序电路仿真</a>
  </li>
  <li class="nav-item" data-depth="1">
    <a class="nav-link" href="ds-other-useful.html">几个有用的组件</a>
  </li>
  <li class="nav-item" data-depth="1">
    <a class="nav-link" href="ds-hierarchical-design.html">层次化设计</a>
  </li>
  <li class="nav-item" data-depth="1">
    <a class="nav-link" href="ds-parametric-design.html">参数化设计</a>
  </li>
</ul>
  </li>
  <li class="nav-item" data-depth="0">
<ul class="nav-list">
  <li class="nav-item" data-depth="1">
    <button class="nav-item-toggle"></button>
    <span class="nav-text">基本逻辑电路</span>
<ul class="nav-list">
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/bl-multiplexer.html">多路选择器实验</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/bl-decoder.html">译码器实验</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/bl-register.html">触发器和寄存器实验</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/bl-counter.html">计数器实验</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/dp-register_file.html">寄存器堆实验</a>
  </li>
</ul>
  </li>
  <li class="nav-item" data-depth="1">
    <button class="nav-item-toggle"></button>
    <span class="nav-text">运算器</span>
<ul class="nav-list">
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/op-add_sub_operation.html">加减运算电路实验</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/op-arithmetic_logic_unit.html">算术逻辑单元实验</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/op-compare.html">*比较运算电路实验</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/dp-single_cycle_datapath.html">运算器数据通路实验</a>
  </li>
</ul>
  </li>
  <li class="nav-item" data-depth="1">
    <button class="nav-item-toggle"></button>
    <span class="nav-text">存储器</span>
<ul class="nav-list">
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/mem-rom.html">ROM实验</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/mem-ram.html">RAM实验</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/mem-path.html">存储器应用实验</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/mem-path-2.html">存储器数据通路实验</a>
  </li>
</ul>
  </li>
</ul>
  </li>
  <li class="nav-item" data-depth="0">
<ul class="nav-list">
  <li class="nav-item" data-depth="1">
    <button class="nav-item-toggle"></button>
    <span class="nav-text">控制器</span>
<ul class="nav-list">
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/cu-overview.html">概述（指令系统）</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/cu-hardwire_controller-1.html">硬布线控制实验（Ⅰ）</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/cu-hardwire_controller.html">硬布线控制实验（Ⅱ）</a>
  </li>
  <li class="nav-item" data-depth="2">
    <a class="nav-link" href="lab/cu-hardwire_controller-3.html">硬布线控制实验（Ⅲ）</a>
  </li>
</ul>
  </li>
</ul>
  </li>
</ul>
  </nav>
</div>
<div class="nav-panel-explore" data-panel="explore">
  <div class="context">
    <span class="title">计算机组成原理实验指导</span>
    <span class="version">1.2</span>
  </div>
  <ul class="components">
    <li class="component is-current">
      <div class="title"><a href="../index.html">计算机组成原理实验指导</a></div>
      <ul class="versions">
        <li class="version is-latest">
          <a href="../index.html">1.31</a>
        </li>
        <li class="version is-current">
          <a href="index.html">1.2</a>
        </li>
        <li class="version">
          <a href="../1.1/index.html">1.1</a>
        </li>
        <li class="version">
          <a href="../1.0/index.html">1.0</a>
        </li>
      </ul>
    </li>
  </ul>
</div>
    </div>
  </aside>
</div>
<main class="article">
<div class="toolbar" role="navigation">
<button class="nav-toggle"></button>
  <a href="../index.html" class="home-link"></a>
<nav class="breadcrumbs" aria-label="breadcrumbs">
  <ul>
    <li><a href="index.html">计算机组成原理实验指导</a></li>
    <li>Digital仿真软件使用指南</li>
    <li><a href="ds-generate-circuit.html">电路生成</a></li>
  </ul>
</nav>
<div class="page-versions">
  <button class="version-menu-toggle" title="Show other versions of page">1.2</button>
  <div class="version-menu">
    <a class="version" href="../ds-generate-circuit.html">1.31</a>
    <a class="version is-current" href="ds-generate-circuit.html">1.2</a>
    <a class="version" href="../1.1/ds-generate-circuit.html">1.1</a>
    <a class="version" href="../1.0/ds-generate-circuit.html">1.0</a>
  </div>
</div>
</div>
  <div class="content">
<aside class="toc sidebar" data-title="页内目录" data-levels="2">
  <div class="toc-menu"></div>
</aside>
<article class="doc">
<h1 class="page">电路生成</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Digital仿真软件不仅可以手工绘制电路图，也可以通过真值表、逻辑表达式、状态图来自动生成电路图。</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_使用真值表生成电路图"><a class="anchor" href="#_使用真值表生成电路图"></a>使用真值表生成电路图</h2>
<div class="sectionbody">
<div class="paragraph">
<p>以具有使能控制的2-4译码器为例，输入输出端口如<a href="#fig-ds-decoder2-4">图 1</a>所示。逻辑功能见<a href="#tab-ds-decoder2-4">表 1</a>。</p>
</div>
<div id="fig-ds-decoder2-4" class="imageblock">
<div class="content">
<img src="_images/decoder2-4.png" alt="decoder2 4">
</div>
<div class="title">图 1. 带有使能控制的2-4译码器</div>
</div>
<table id="tab-ds-decoder2-4" class="tableblock frame-all grid-all stretch">
<caption class="title">表 1. 带有使能控制的2-4译码器真值表</caption>
<colgroup>
<col style="width: 14.2857%;">
<col style="width: 14.2857%;">
<col style="width: 14.2857%;">
<col style="width: 14.2857%;">
<col style="width: 14.2857%;">
<col style="width: 14.2857%;">
<col style="width: 14.2858%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">En</th>
<th class="tableblock halign-left valign-top">A1</th>
<th class="tableblock halign-left valign-top">A0</th>
<th class="tableblock halign-left valign-top">Y0</th>
<th class="tableblock halign-left valign-top">Y1</th>
<th class="tableblock halign-left valign-top">Y2</th>
<th class="tableblock halign-left valign-top">Y3</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">X</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">X</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">0</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>根据真值表生成电路的步骤如下。</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>在Digital仿真软件中点击菜单项“Analysis/分析 ➤ Synthesis/综合”，打开真值表编辑窗口。</p>
</li>
<li>
<p>在真值表窗口中点击菜单项“New/新建 ➤ Combinatorial/组合电路 ➤ 3 variables/3变量”，窗口中显示有3个输入、1个输出的真值表，并且3个输入的数据也已经按穷举法生成，输出则全部为0。</p>
</li>
<li>
<p>右键点击第一列的标题行A，将其改为“En”，接着将第2列、第3列的标题分别改为“A1”、“A0”。</p>
</li>
<li>
<p>点击菜单项“Edit/编辑 ➤ Add Output Column / 添加输出列”三次，然后将4列输出的标题行分别改为“Y0”、“Y1”、“Y2”、“Y3”。</p>
</li>
<li>
<p>根据<a href="#tab-ds-decoder2-4">表 1</a>的真值表修改4列输出的数值。</p>
</li>
<li>
<p>点击菜单项“Create/创建 ➤ Circuit/电路”，将在新窗口中生成电路。</p>
</li>
<li>
<p>点击菜单项“File/文件 ➤ Save as/另存为”保存生成的电路。</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_使用逻辑表达式生成电路图"><a class="anchor" href="#_使用逻辑表达式生成电路图"></a>使用逻辑表达式生成电路图</h2>
<div class="sectionbody">
<div class="paragraph">
<p>在Digital仿真软件中点击菜单项“Analysis/分析 ➤ Expression/表达式”，打开表达式编辑窗口。</p>
</div>
<div class="paragraph">
<p>可以使用多种常见的符号书写逻辑表达式：</p>
</div>
<div class="ulist">
<ul>
<li>
<p>与："&amp;"，"*"</p>
</li>
<li>
<p>或："|"，"+"，"#"</p>
</li>
<li>
<p>异或："^"</p>
</li>
<li>
<p>非："~"，"!"</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>和常规一样，与运算优先级高于或运算和异或运算。
多个表达式可以用“，”或“;”分隔。
如果需要命名表达式，可以使用 <code>let</code> 命令，如</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">let U=A+B，let V=A*B</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_使用有限状态机生成电路图"><a class="anchor" href="#_使用有限状态机生成电路图"></a>使用有限状态机生成电路图</h2>
<div class="sectionbody">
<div class="paragraph">
<p>在Digital仿真软件中点击菜单项“Analysis/分析 ➤ Finite State Machine / 有限状态机”，打开状态机编辑窗口。有关状态机的输入方法可点击该窗口的“Help”菜单查阅。</p>
</div>
<div class="sidebarblock text-center">
<div class="content">
<div class="title">许可 | License</div>
<div class="paragraph">
<p><a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA：署名-非商业性使用-相同方式共享 4.0 国际许可协议</a></p>
</div>
<div class="paragraph">
<p>作者：
肖铁军 &lt;<a href="mailto:xiaotiejun@foxmail.com.cn">xiaotiejun@foxmail.com.cn</a>&gt;</p>
</div>
</div>
</div>
</div>
</div>
</article>
  </div>
</main>
</div>
<footer class="footer">
  <p>This page was built using the Antora default UI.</p>
  <p>The source code for this UI is licensed under the terms of the MPL-2.0 license.</p>
</footer>
<script id="site-script" src="../../_/js/site.js" data-ui-root-path="../../_"></script>
<script async src="../../_/js/vendor/highlight.js"></script>
  </body>
</html>
